﻿<UserControl x:Class="MoonyWeather.WeatherSettings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Unloaded="UserControl_Unloaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"  />
            <RowDefinition Height="Auto"  />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center">
            <StackPanel Orientation="Horizontal" Margin="3">
                <TextBlock VerticalAlignment="Center" Margin="0,0,7,0">Units:</TextBlock>
                <RadioButton x:Name="rbC" Margin="0,0,7,0" GroupName="units">°C</RadioButton>
                <RadioButton x:Name="rbF" Margin="0,0,7,0" GroupName="units" Checked="RadioButton_Checked" Unchecked="RadioButton_Unchecked">°F</RadioButton>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="3">
                <TextBlock Margin="0,0,7,0" VerticalAlignment="Center">Location (WOEID): </TextBlock>
                <TextBox 
                    Width="100" 
                    TextChanged="TextBox_TextChanged"
                    SelectionChanged="TextBox_SelectionChanged"
                    Text="{Binding Path=WOEID}"></TextBox>
            </StackPanel>
        </StackPanel>
        <TextBlock Grid.Row="1" FontWeight="Bold" HorizontalAlignment="Right" Margin="0,0,7,0" SnapsToDevicePixels="True">
            Weather forecast by YAHOO!
            <Hyperlink  NavigateUri="http://weather.yahoo.com" RequestNavigate="Hyperlink_RequestNavigate">
                weather.yahoo.com
            </Hyperlink>
        </TextBlock>
        <Border Grid.Row="2" Margin="7" Background="#EEE" Padding="7">
            <StackPanel>
                <TextBlock SnapsToDevicePixels="True" TextWrapping="Wrap" HorizontalAlignment="Stretch">
                        To find your WOEID, browse or search for your city from the Weather 
                        <Hyperlink NavigateUri="http://weather.yahoo.com" RequestNavigate="Hyperlink_RequestNavigate">home page</Hyperlink>. 
                        The WOEID is in the URL for the forecast page for that city. 
                        You can also get the WOEID by entering your zip code on the home page. 
                        For example, if you search for Los Angeles on the Weather home page, 
                        the forecast page for that city is 
                        <Hyperlink NavigateUri="http://weather.yahoo.com/united-states/california/los-angeles-2442047/" RequestNavigate="Hyperlink_RequestNavigate">
                            http://weather.yahoo.com/united-states/california/los-angeles-2442047/
                        </Hyperlink>. 
                    The WOEID is 2442047.
                </TextBlock>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
